<template>
  <view
    class="content"
    :style="{
    //   'padding-top': height + 'px',
    }"
  >
    <view
      :style="{
        width: '100%',
        height: statusBarHeight + 'px',
        background: 'white',
        position: 'fixed',
        top: 0,
        zIndex: 100,
      }"
    >
    </view>
    <view
      class="head"
      :style="{
        top: statusBarHeight + 'px',
      }"
    >
      <view class="head_left">
        <u-icon
          name="arrow-left"
          color="#444"
          size="24"
          :bold="true"
          @click="toBack"
        ></u-icon>
      </view>
      <view class="text">{{ title }}</view>
    </view>
    <view class="box" :style="{marginTop:height+statusBarHeight+'px'}">
      <people-list :list="{ data: list }"></people-list>
	  <view :style="{height:'100rpx'}"></view>
    </view>
	<floatingBall></floatingBall>
  </view>
</template>

<script>
import peopleList from "./components/newPeopleList.vue";
import { renwuList } from "@/common/api/renwu.js";
export default {
  components: {
    peopleList,
  },
  data() {
    return {
      statusBarHeight: 0,
      height: 0,
      id: -1,
      page: 1,
      list: [],
      title: "",
	  search:'',
	  type:0
    };
  },
  created() {
    const statusBarHeight = uni.getSystemInfoSync(); // 获取手机状态栏高度
    this.statusBarHeight = statusBarHeight.statusBarHeight;
    const windowHeihgt = statusBarHeight.windowHeight;
    this.$nextTick(() => {
      uni
        .createSelectorQuery()
        .select(".head")
        .boundingClientRect((data) => {
          this.height = data.height;
        })
        .exec();
    });
  },
  onLoad(options) {
    if (options && options.id) {
      this.id = options.id;
      this.title = options.title;
	  if (options.search) {
		  this.search = options.search;
		  console.log('options.searchoptions.search',options.search);
	  }
	  if (options.type) {
		  this.type = options.type;
	  }
      this.getDetail();
    }
	
  },
  methods: {
    getDetail() {
      renwuList({
        id: this.id,
        type: this.type,
        search: this.search,
        page: this.page,
      }).then((res) => {
        this.list = res.data.list.data;
        console.log("resssss", res);
      });
    },
    toBack() {
      uni.navigateBack({
        delta: 1,
      });
    },
  },
};
</script>

<style scoped lang="scss">
.content {
  box-sizing: border-box;
}
.head {
  width: 100%;
  padding: 18rpx 0 47rpx;
  position: fixed;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  z-index: 99;

  .head_left {
    position: absolute;
    left: 30rpx;
  }

  .text {
    font-size: 36rpx;
    font-family: PingFang SC-Bold, PingFang SC;
    font-weight: 400;
    color: #444;
  }
}
.box {
  padding: 0 30rpx;
  box-sizing: border-box;
}
</style>